<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>活动照片</title>
		<link rel="stylesheet" href="css/upWindow.css" />
		<link rel="stylesheet" href="css/style.css" />
		<link rel="stylesheet" href="css/MomPhotoDetail.css" />
		<link rel="stylesheet" href="css/style.css" />
	    <link rel="stylesheet" href="css/base.css"/>
		<script type="text/javascript" src="js/dom/jquery.js" ></script>
	    <script type="text/javascript" src="js/register.js"></script>
	    <script type="text/javascript" src="js/topPublic.js"></script>
	</head>
	<body>
		<!--<a href="#top" hidden></a>-->
		<script type="text/javascript" src="js/header.js" ></script>
		<div class="banner-img">
			<img src="img/img_02.png" />
		</div>
		<div class="main-part">
			<div class="main-part-left">
				<p class="title" id="mom_title"></p>
				<p class="mom_time" id="mom_time"></p>
				<p class="mom_detail" id="mom_detail"></p>
				<div class="img-list" id="mimg_list">
					
				</div>
			</div>
			<div class="main-part-right">
				<p style="width:380px;height:54px;background-color: #EB6100;overflow: hidden;">
					<img style="float: left;margin: 10px 10px 10px 20px;" src="img/hot_05.png" />
					<span style="float:left;color: #ffffff;font-size: 24px;line-height: 54px;">活动照片</span>
				</p>
				<div class="photo-scroll">
					<ul id="mom_list">
					</ul>
				</div>
			</div>
		</div>
		<input type="hidden" value="tv" id="navid" />
		<script type="text/javascript" src="js/footer.js" ></script>
		<script type="text/javascript" src="js/banner.js" ></script>
		<script>
			function getQueryString(name) {
				var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
				var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
				var context = "";
				if(r != null)
					context = r[2];
				reg = null;
				r = null;
				return context == null || context == "" || context == "undefined" ? "" : context;
			}
//			submitcomm(getQueryString('sid'));

			$(function() {

				$.ajax({
					url: '/baby/usaBabyMonth/queryMenuUsaBabyMonth', // 跳转到 action  
					data: {
						menutype : 'a129d72574344578b7291cff1d72e542'
					},
					type: 'post',
					cache: false,
					dataType: 'json',
					success: function(data) {
						console.log(data);
						if(data.code == "2000") {
							var str = data.data;
							var htmlstr='';
							for (i=0;i<str.length;i++) {
								var comurl = "activityPhotoDetail.html?sid=" + str[i].sid;
								htmlstr += '<li class="photo-part" onclick="window.location.href=\'activityPhotoDetail.html?sid='+str[i].sid+'\'">' +
								'<img src="' + str[i].imgData[0].realPicUrl + '@!cpr" />' +
								'<p><a>' + str[i].title +'</a></p>';
							}
							document.getElementById("mom_list").innerHTML = htmlstr
						} else if(data.code == "5001") {
							alert(data.message);

						}
					},
					error: function() {
						// view("异常！");  
						console.log("异常！");
					}
				});
			})

			$(function() {
				demo();

			});

			function demo(curr) {
				var key = getQueryString('sid')
	
				$.ajax({
					url: '/baby/usaBabyMonth/getUsaBabyMonth', // 跳转到 action  
					data: {
						sid: key
					},
					type: 'post',
					cache: false,
					dataType: 'json',
					success: function(data) {
						console.log(data);
						if(data.code == "2000") {
							if(data.data == null) {
								alert("没有找到数据");
								return
							}
							var data = data.data;
						$("#mom_title").html(data.title);
						$("#mom_time").html(data.createTime);
//						$("#mom_detail").html(data.introduce);
							//拼页面
							var htmlstr = '';
							for(var i = 0; i < data.imgData.length; i++) {
								var obj = data.imgData[i]; //获取单个数据对象
								var imgitem ='<img src="'+data.imgData[i].realPicUrl+'@!cpr" />'
								 $("#mimg_list").append(imgitem);
							}
							document.getElementById("mom_list").innerHTML = htmlstr
								
						} else if(data.code == "5001") {
							alert(data.message);
							

						}
					},
					error: function() {
						// view("异常！");  
						//alert("异常！");
					}
				});
			};
		</script>
	</body>
</html>
